/* 引入cookie */
import Cookie from 'js-cookie';

/* 头部字段 */
const key = 'authorization';

/* 设置token */
export let setToken = (value: string) => {
    /* 设置token与时间(5小时后过期) */
    Cookie.set(key, value, {expires:new Date(+new Date()+5*60*60*1000)});
}

/* 获取token */
export let getToken = () => {
    /* 获取token */
    return Cookie.get(key);
};

/* 移除token */
export let removeToken = () =>{
    Cookie.remove(key);
}